#ifndef FUZZYBRAIN_H
#define FUZZYBRAIN_H

#define NINVAR 8

#include<fuzzylite/InputLVar.h>
#include<fuzzylite/FuzzyEngine.h>
#include<fuzzylite/FunctionTerm.h>
#include<fstream>
#include<string>
using namespace std;

class FuzzyBrain{

public:
    FuzzyBrain(string);
    ~FuzzyBrain();
    string execute();
    void setHealtVars(fl::flScalar *);
    void setPowerVars(fl::flScalar *);
    void setDistanceVars(fl::flScalar *);
    void setVelocityVars(fl::flScalar *);

private:
    //attributi
    fl::FuzzyEngine mEngine;
    fl::RuleBlock *mRules;
    fl::InputLVar *mInputVars;
    fl::OutputLVar *mStato;
    fl::InputLVar varDistance(string);
    fl::InputLVar varHSP(string);
    fl::InputLVar number(string);
    //metodi
    void addVar(fl::InputLVar,int*);
    void setInput(fl::flScalar *,int, int);

protected:
    void createInputVars();
    void createOutputVars();
    void readRules(string);
};

#endif // FUZZYBRAIN_H
